<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
		<title>登录</title>
		<link rel="stylesheet" href="${BASE_PATH}/static/app/css/base.css" />
		<link rel="stylesheet" type="text/css" href="${BASE_PATH}/static/app/css/header.css"/>
		<link rel="stylesheet" href="${BASE_PATH}/static/app/css/public.css" />
		<link rel="stylesheet" href="${BASE_PATH}/static/app/css/login.css" />
		<link rel="stylesheet" href="${BASE_PATH}/static/lib/myAlert/myAlert.css" />
		<style>
		
		</style>
	</head>
	<body>
		<div class="header_order">
			<span class="back" onclick="javascript:history.go(-1);"></span>
			<span class="header_text">登录</span>
		</div>
		<div class="user line">
			<span>账号</span>
			<input type="text" id="phoneInpt" placeholder="请输入手机号码" />
		</div>
		<div class="pwd line">
			<span>密码</span>
			<input type="password" id="passwordInpt" placeholder="请输入密码" />
		</div>
		<div class="ok" onclick="doLogin()">登录</div>
		<div class="go">
			<span class="sign fL"><a href="${BASE_PATH}/regist">手机注册</a></span>
			<span class="forget_pwd fR"><a href="${BASE_PATH}/reset">忘记密码？</a></span>
		</div>
		<script type="text/javascript" src="${BASE_PATH}/static/app/js/jquery-3.1.1.min.js"></script>
		<script type="text/javascript" src="${BASE_PATH}/static/lib/layer/layer.js"></script>
		<script type="text/javascript" src="${BASE_PATH}/static/app/js/kit.js"></script>
		<script type="text/javascript" src="${BASE_PATH}/static/lib/myAlert/module.js"></script>
		<script type="text/javascript">
			function doLogin(){
				var phone = $("#phoneInpt").val();
				var password = $("#passwordInpt").val();
				Kit.ajax.post("${BASE_PATH}/doLogin",{phone:phone,password:password},function(result){
					if(result.flag==1){
						Kit.ui.alert("手机号不能为空！");
					}else if(result.flag==2){
						Kit.ui.alert("手机号不正确！");
					}else if(result.flag==3){
						Kit.ui.alert("密码不能为空！");
					}else if(result.flag==4){
						Kit.ui.alert("用户不存在或密码错误！");
					}else if(result.flag==5){
						Kit.ui.alert("更新登录状态出错，请重新登录！");
					}else if(result.flag==0){
					/* 	Kit.ui.alert("登录成功！",function(){ */
							Kit.render.redirect("${BASE_PATH}/index");
					/* 	}); */
					}
				});
			}
			var width = $('.fw-tel').width()
			$('.fw-tel').css('margin-left',-width/2);
		</script>
	</body>
</html>
